﻿<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script type="text/javascript">
	    var path = window.document.location.href;
		var pathName = window.document.location.pathname;
		var hostPath = path.substring(0, path.indexOf(pathName));
		var projectName = pathName.substring(0, pathName.substr(1).indexOf("/") + 1);
		document.write('<scr' + 'ipt src="' + projectName + '/js/jquery-easyui/jquery.min.js"></scr'+'ipt>');
		document.write('<scr' + 'ipt src="' + projectName + '/js/artDialog/artDialog.js?skin=default"></scr'+'ipt>');
		document.write('<scr' + 'ipt src="' + projectName + '/js/artDialog/jquery.artDialog.js?skin=default"></scr'+'ipt>');
		document.write('<scr' + 'ipt src="' + projectName + '/js/echarts/echarts.js"></scr'+'ipt>');
    </script>
	<title>系统</title>
</head>
<body>
	<div id="container">
		<table class="table" cellspacing="0" cellpadding="0" width="100%" align="center"  border="0">
		    <tr>
		      <th colspan="2">系统信息</th>
		    </tr>
		    <tr>
		      <td width="100" height="30">公共信息：<span class="TableRow2"></span></td>
		      <td style="text-align:left">欢迎使用</td>
		    </tr>
		</table>
		<div id="write" style="height: 50px"></div>
		<table class="table" cellspacing="0" cellpadding="0" width="100%" align="center"  border="0">
		    <tr>
		    	<td>
		    		<div id="countofbusinesstop" style="height:300px;width:450px"></div>
		    	</td>
		      	<td>
		      		<div id="myChart2" style="height:300px;width:450px"></div>
		      	</td>
		    </tr>
		    <tr>
		    	<td>
		    		<div id="myChart3" style="height:300px;width:450px"></div>
		      	</td>
		      	<td>
		      		<div id="myChart4" style="height:300px;width:450px"></div>
		      	</td>
		    </tr>
		</table>
	</div>
	<script type="text/javascript">
		var initd = {
			queryDataURL:"",//查询URL
			saveDataURL:"",//保存URL
			removeDataURL:"",//删除URL
			dg:$('#dg'),
			dataDicList:{'ORG':['parentId'],'STATUS':['status'],'30':['orgGrade']}//需加载的 DATADIC 字典名+作用的字段名
		};
	
    	var myChart1 = echarts.init(document.getElementById('countofbusinesstop'));
    	var myChart2 = echarts.init(document.getElementById('myChart2'));
    	var myChart3 = echarts.init(document.getElementById('myChart3'));
    	var myChart4 = echarts.init(document.getElementById('myChart4'));
    	
		option1 = {
		    title : {
		        text: '交易量Top10',
		    },
		    tooltip : {
		        trigger: 'axis'
		    },
		    legend: {
		        data:['笔数']
		    },
		    toolbox: {
		        show : true,
		        feature : {
		            dataView : {show: true, readOnly: false},
		            magicType : {show: true, type: ['line', 'bar']},
		            restore : {show: true},
		            saveAsImage : {show: true}
		        }
		    },
		    calculable : true,
		    xAxis : [
		        {
		            type : 'category',
		            data : []
		        }
		    ],
		    yAxis : [
		        {
		            type : 'value'
		        }
		    ],
		    series : [
		        {
		            name:'笔数',
		            type:'line',
		            data:[],
		            markPoint : {
		                data : [
		                    {type : 'max', name: '最大值'},
		                    {type : 'min', name: '最小值'}
		                ]
		            },
		            markLine : {
		                data : [
		                    {type : 'average', name: '平均值'}
		                ]
		            }
		        }
		    ]
		};
		
		option2 = {
			    title : {
			        text: '交易耗时(毫秒)Top10',
			    },
			    tooltip : {
			        trigger: 'axis'
			    },
			    legend: {
			        data:['耗时']
			    },
			    toolbox: {
			        show : true,
			        feature : {
			            dataView : {show: true, readOnly: false},
			            magicType : {show: true, type: ['line', 'bar']},
			            restore : {show: true},
			            saveAsImage : {show: true}
			        }
			    },
			    calculable : true,
			    xAxis : [
			        {
			            type : 'category',
			            data : []
			        }
			    ],
			    yAxis : [
			        {
			            type : 'value'
			        }
			    ],
			    series : [
			        {
			            name:'耗时',
			            type:'line',
			            data:[],
			            markPoint : {
			                data : [
			                    {type : 'max', name: '最大值'},
			                    {type : 'min', name: '最小值'}
			                ]
			            },
			            markLine : {
			                data : [
			                    {type : 'average', name: '平均值'}
			                ]
			            }
			        }
			    ]
			};
		
		option3 = {
			    title : {
			        text: '交易分布Top10',
			        x: 'center'
			    },
			    tooltip : {
			        trigger: 'item',
			        formatter: "{a} <br/>{b} : {c} ({d}%)"
			    },
			    legend: {
			    	orient: 'vertical',
			    	left:'left',
			        data:[]
			    },
			    toolbox: {
			        show : true,
			        feature : {
			            dataView : {show: true, readOnly: false},
			            restore : {show: true},
			            saveAsImage : {show: true}
			        }
			    },
			    series : [
			        {
			            name:'地区',
			            type:'pie',
			            radius: '55%',
			            center: ['50%','60%'],
			            data:[],
			            itemStyle: {
			            	emphasis: {
			            		shadowBlur: 10,
			            		shadowOffsetX: 10,
			            		shadowColor: 'rgba(0, 0, 0, 0, 5)'
			            	}
			            }
			        }
			    ]
			};
		
		option4 = {
			    title : {
			        text: '交易成功率Top10',
			    },
			    tooltip : {
			        trigger: 'axis'
			    },
			    legend: {
			        data:['成功率']
			    },
			    toolbox: {
			        show : true,
			        feature : {
			            dataView : {show: true, readOnly: false},
			            magicType : {show: true, type: ['line', 'bar']},
			            restore : {show: true},
			            saveAsImage : {show: true}
			        }
			    },
			    calculable : true,
			    xAxis : [
			        {
			            type : 'category',
			            data : []
			        }
			    ],
			    yAxis : [
			        {
			            type : 'value'
			        }
			    ],
			    series : [
			        {
			            name:'成功率',
			            type:'bar',
			            data:[],
			            markPoint : {
			                data : [
			                    {type : 'max', name: '最大值'},
			                    {type : 'min', name: '最小值'}
			                ]
			            },
			            markLine : {
			                data : [
			                    {type : 'average', name: '平均值'}
			                ]
			            }
			        }
			    ]
			};
			
		
		$(function(){
			$.ajax({
				type : "POST",
				url : projectName+"/analyze/countOfBusinessTop",
				crossDomain:true,
				xhrFields:{
					withCredentials:true
				},
				data: {},
				dataType : "json",
				success : function(data) {
					if (!data.success) {
						alert(data.message);
						return;
					}
					if (data != null) {
						option1.xAxis[0].data = data.outBean.xAxis;
						option1.series[0].data = data.outBean.columnSeries[0];
						myChart1.setOption(option1); 
					}
				},
        		error:function(err, status){
        			$.messager.alert("系统提示", err.responseText);
        		}
			});
			
			$.ajax({
				type : "POST",
				url : projectName+"/analyze/timeOfBusinessTop",
				crossDomain:true,
				xhrFields:{
					withCredentials:true
				},
				data: {},
				dataType : "json",
				success : function(data) {
					if (!data.success) {
						alert(data.message);
						return;
					}
					if (data != null) {
						option2.xAxis[0].data = data.outBean.xAxis;
						option2.series[0].data = data.outBean.columnSeries[0];
						myChart2.setOption(option2); 
					}
				},
        		error:function(err, status){
        			$.messager.alert("系统提示", err.responseText);
        		}
			});
			
			$.ajax({
				type : "POST",
				url : projectName+"/analyze/countDistribution",
				crossDomain:true,
				xhrFields:{
					withCredentials:true
				},
				data: {},
				dataType : "json",
				success : function(data) {
					if (!data.success) {
						alert(data.message);
						return;
					}
					if (data != null) {
						option3.legend.data = data.outBean.legend;
						option3.series[0].data = data.outBean.pieSeries[0];
						myChart3.setOption(option3); 
					}
				},
        		error:function(err, status){
        			$.messager.alert("系统提示", err.responseText);
        		}
			});
			
			$.ajax({
				type : "POST",
				url : projectName+"/analyze/succRateOfBusinessTop",
				crossDomain:true,
				xhrFields:{
					withCredentials:true
				},
				data: {},
				dataType : "json",
				success : function(data) {
					if (!data.success) {
						alert(data.message);
						return;
					}
					if (data != null) {
						option4.xAxis[0].data = data.outBean.xAxis;
						option4.series[0].data = data.outBean.columnSeries[0];
						myChart4.setOption(option4); 
					}
				},
        		error:function(err, status){
        			$.messager.alert("系统提示", err.responseText);
        		}
			});
		})
		
    </script>
</body>
</html>
